package com.itbaizhan.rocketmqconsumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
/*topic :要与生产者发送的主题一样*/
@RocketMQMessageListener(topic = "topic_springboot_01",consumerGroup = "consumer_group")
public class MyListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        //处理broker发来的消息
        log.info(s);
    }
}
